﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using VisionCloud.Core.Model.Ms;

namespace VisionCloud.Core.ModelConfig.Measure
{
    public class MsTaskConfig : IEntityTypeConfiguration<MsTask>
    {
        public void Configure(EntityTypeBuilder<MsTask> builder)
        {
            builder.ToTable("ms_task")
                .HasKey(w => w.TaskId);

            builder.Property(w => w.TaskId).HasMaxLength(8);
            builder.Property(w => w.ProjectName).HasMaxLength(50).IsRequired();

            builder.Property(w => w.BuildingBlock).HasMaxLength(50);
            builder.Property(w => w.BuildingUnit).HasMaxLength(50);
            builder.Property(w => w.RoomNo).HasMaxLength(50);
        }
    }
}